package com.team.employment.web.app.custom.config;

/*
    注册StringToItemTypeConverter转换器
 */

import com.team.employment.web.app.custom.converter.StringToBaseEnumConverterFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AppWebMvcConfiguration implements WebMvcConfigurer {

    @Override
    public void addFormatters(FormatterRegistry registry) {

        //通用枚举转换器
        registry.addConverterFactory(new StringToBaseEnumConverterFactory());
    }
}
